home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / flex-2.4.6 / parse.tab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-23  |  40.9 KB  |  1,675 lines  |  [TEXT/KAHL]

  1.  
  2. /*  A Bison parser, made from parse.y  */
  3.  
  4. #define YYBISON 1  /* Identify Bison output.  */
  5.  
  6. #define    CHAR    258
  7. #define    NUMBER    259
  8. #define    SECTEND    260
  9. #define    SCDECL    261
  10. #define    XSCDECL    262
  11. #define    WHITESPACE    263
  12. #define    NAME    264
  13. #define    PREVCCL    265
  14. #define    EOF_OP    266
  15.  
  16. #line 5 "parse.y"
  17.  
  18. /*-
  19.  * Copyright (c) 1990 The Regents of the University of California.
  20.  * All rights reserved.
  21.  *
  22.  * This code is derived from software contributed to Berkeley by
  23.  * Vern Paxson.
  24.  * 
  25.  * The United States Government has rights in this work pursuant
  26.  * to contract no. DE-AC03-76SF00098 between the United States
  27.  * Department of Energy and the University of California.
  28.  *
  29.  * Redistribution and use in source and binary forms are permitted provided
  30.  * that: (1) source distributions retain this entire copyright notice and
  31.  * comment, and (2) distributions including binaries display the following
  32.  * acknowledgement:  ``This product includes software developed by the
  33.  * University of California, Berkeley and its contributors'' in the
  34.  * documentation or other materials provided with the distribution and in
  35.  * all advertising materials mentioning features or use of this software.
  36.  * Neither the name of the University nor the names of its contributors may
  37.  * be used to endorse or promote products derived from this software without
  38.  * specific prior written permission.
  39.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  40.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  41.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  42.  */
  43.  
  44. /* $Header: /home/daffy/u0/vern/flex/RCS/parse.y,v 2.15 93/12/09 13:57:23 vern Exp $ */
  45.  
  46.  
  47. /* Some versions of bison are broken in that they use alloca() but don't
  48.  * declare it properly.  The following is the patented (just kidding!)
  49.  * #ifdef chud to fix the problem, courtesy of Francois Pinard.
  50.  */
  51. #ifdef YYBISON
  52. /* AIX requires this to be the first thing in the file.  */
  53. #ifdef __GNUC__
  54. #define alloca __builtin_alloca
  55. #else /* not __GNUC__ */
  56. #if HAVE_ALLOCA_H
  57. #include <alloca.h>
  58. #else /* not HAVE_ALLOCA_H */
  59. #ifdef _AIX
  60.  #pragma alloca
  61. #else /* not _AIX */
  62. char *alloca ();
  63. #endif /* not _AIX */
  64. #endif /* not HAVE_ALLOCA_H */
  65. #endif /* not __GNUC__ */
  66. #endif /* YYBISON */
  67.  
  68. /* Bletch, ^^^^ that was ugly! */
  69.  
  70.  
  71. #include "flexdef.h"
  72.  
  73. int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
  74. int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule;
  75. int *active_ss;
  76. Char clower();
  77. void build_eof_action();
  78. void yyerror();
  79.  
  80. static int madeany = false;  /* whether we've made the '.' character class */
  81. int previous_continued_action;    /* whether the previous rule's action was '|' */
  82.  
  83. /* On some over-ambitious machines, such as DEC Alpha's, the default
  84.  * token type is "long" instead of "int"; this leads to problems with
  85.  * declaring yylval in flexdef.h.  But so far, all the yacc's I've seen
  86.  * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the
  87.  * following should ensure that the default token type is "int".
  88.  */
  89. #define YYSTYPE int
  90.  
  91.  
  92. #ifndef YYLTYPE
  93. typedef
  94.   struct yyltype
  95.     {
  96.       int timestamp;
  97.       int first_line;
  98.       int first_column;
  99.       int last_line;
  100.       int last_column;
  101.       char *text;
  102.    }
  103.   yyltype;
  104.  
  105. #define YYLTYPE yyltype
  106. #endif
  107.  
  108. #ifndef YYSTYPE
  109. #define YYSTYPE int
  110. #endif
  111. #include <stdio.h>
  112.  
  113. #ifndef __STDC__
  114. #define const
  115. #endif
  116.  
  117.  
  118.  
  119. #define    YYFINAL        85
  120. #define    YYFLAG        -32768
  121. #define    YYNTBASE    32
  122.  
  123. #define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 53)
  124.  
  125. static const char yytranslate[] = {     0,
  126.      2,     2,     2,     2,     2,     2,     2,     2,     2,    12,
  127.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  128.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  129.      2,     2,     2,    26,     2,    18,     2,     2,     2,    27,
  130.     28,    16,    21,    17,    31,    25,    20,     2,     2,     2,
  131.      2,     2,     2,     2,     2,     2,     2,     2,     2,    14,
  132.      2,    15,    22,     2,     2,     2,     2,     2,     2,     2,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  134.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  135.     29,     2,    30,    13,     2,     2,     2,     2,     2,     2,
  136.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  137.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  138.      2,     2,    23,    19,    24,     2,     2,     2,     2,     2,
  139.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  140.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  141.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  142.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  143.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  144.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  145.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  146.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  147.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  148.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  149.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  150.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  151.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  152.      6,     7,     8,     9,    10,    11
  153. };
  154.  
  155. #if YYDEBUG != 0
  156. static const short yyprhs[] = {     0,
  157.      0,     6,     7,    13,    14,    17,    19,    21,    23,    27,
  158.     29,    31,    36,    37,    38,    42,    45,    48,    50,    53,
  159.     55,    57,    61,    65,    69,    70,    73,    75,    77,    80,
  160.     84,    87,    89,    93,    95,    98,   101,   103,   106,   109,
  161.    112,   119,   125,   130,   132,   134,   136,   140,   144,   146,
  162.    150,   155,   160,   163,   164,   167
  163. };
  164.  
  165. #endif
  166.  
  167. static const short yyrhs[] = {    33,
  168.     34,    35,    38,    39,     0,     0,    34,    36,     8,    37,
  169.     12,     0,     0,     1,    12,     0,     5,     0,     6,     0,
  170.      7,     0,    37,     8,     9,     0,     9,     0,     1,     0,
  171.     38,    39,    40,    12,     0,     0,     0,    41,    13,    45,
  172.      0,    41,    45,     0,    13,    45,     0,    45,     0,    41,
  173.     11,     0,    11,     0,     1,     0,    14,    42,    15,     0,
  174.     14,    16,    15,     0,    42,    17,    44,     0,     0,    43,
  175.     44,     0,     1,     0,     9,     0,    47,    46,     0,    47,
  176.     46,    18,     0,    46,    18,     0,    46,     0,    46,    19,
  177.     48,     0,    48,     0,    46,    20,     0,    48,    49,     0,
  178.     49,     0,    49,    16,     0,    49,    21,     0,    49,    22,
  179.      0,    49,    23,     4,    17,     4,    24,     0,    49,    23,
  180.      4,    17,    24,     0,    49,    23,     4,    24,     0,    25,
  181.      0,    50,     0,    10,     0,    26,    52,    26,     0,    27,
  182.     46,    28,     0,     3,     0,    29,    51,    30,     0,    29,
  183.     13,    51,    30,     0,    51,     3,    31,     3,     0,    51,
  184.      3,     0,     0,    52,     3,     0,     0
  185. };
  186.  
  187. #if YYDEBUG != 0
  188. static const short yyrline[] = { 0,
  189.     82,   111,   124,   125,   126,   130,   143,   146,   150,   153,
  190.    156,   160,   161,   164,   175,   195,   206,   230,   241,   244,
  191.    263,   267,   269,   278,   280,   282,   282,   286,   307,   362,
  192.    365,   408,   426,   432,   437,   464,   472,   476,   483,   489,
  193.    495,   523,   537,   556,   578,   596,   603,   606,   609,   620,
  194.    623,   630,   658,   669,   677,   687
  195. };
  196.  
  197. static const char * const yytname[] = {   "$","error","$illegal.","CHAR","NUMBER",
  198. "SECTEND","SCDECL","XSCDECL","WHITESPACE","NAME","PREVCCL","EOF_OP","'\\n'",
  199. "'^'","'<'","'>'","'*'","','","'$'","'|'","'/'","'+'","'?'","'{'","'}'","'.'",
  200. "'\"'","'('","')'","'['","']'","'-'","goal","initlex","sect1","sect1end","startconddecl",
  201. "namelist1","sect2","initforrule","flexrule","scon","namelist2","@1","sconname",
  202. "rule","re","re2","series","singleton","fullccl","ccl","string",""
  203. };
  204. #endif
  205.  
  206. static const short yyr1[] = {     0,
  207.     32,    33,    34,    34,    34,    35,    36,    36,    37,    37,
  208.     37,    38,    38,    39,    40,    40,    40,    40,    40,    40,
  209.     40,    41,    41,    42,    43,    42,    42,    44,    45,    45,
  210.     45,    45,    46,    46,    47,    48,    48,    49,    49,    49,
  211.     49,    49,    49,    49,    49,    49,    49,    49,    49,    50,
  212.     50,    51,    51,    51,    52,    52
  213. };
  214.  
  215. static const short yyr2[] = {     0,
  216.      5,     0,     5,     0,     2,     1,     1,     1,     3,     1,
  217.      1,     4,     0,     0,     3,     2,     2,     1,     2,     1,
  218.      1,     3,     3,     3,     0,     2,     1,     1,     2,     3,
  219.      2,     1,     3,     1,     2,     2,     1,     2,     2,     2,
  220.      6,     5,     4,     1,     1,     1,     3,     3,     1,     3,
  221.      4,     4,     2,     0,     2,     0
  222. };
  223.  
  224. static const short yydefact[] = {     2,
  225.      0,     0,     0,     5,     6,     7,     8,    13,     0,    14,
  226.      0,     0,    11,    10,     0,    21,    49,    46,    20,     0,
  227.      0,    44,    56,     0,    54,     0,     0,    18,    32,     0,
  228.     34,    37,    45,     0,     3,    17,    27,     0,     0,     0,
  229.      0,     0,    54,     0,    12,    19,     0,    16,    31,     0,
  230.     35,    29,    36,    38,    39,    40,     0,     9,    23,    22,
  231.      0,    28,    26,    55,    47,    48,     0,    53,    50,    15,
  232.     33,    30,     0,    24,    51,     0,     0,    43,    52,     0,
  233.     42,    41,     0,     0,     0
  234. };
  235.  
  236. static const short yydefgoto[] = {    83,
  237.      1,     3,     8,     9,    15,    10,    12,    26,    27,    39,
  238.     40,    63,    28,    29,    30,    31,    32,    33,    44,    41
  239. };
  240.  
  241. static const short yypact[] = {-32768,
  242.     61,    -2,    64,-32768,-32768,-32768,-32768,-32768,    13,-32768,
  243.     34,     1,-32768,-32768,    30,-32768,-32768,-32768,-32768,    21,
  244.     48,-32768,-32768,    21,    31,    33,    26,-32768,    54,    21,
  245.     21,    38,-32768,    47,-32768,-32768,-32768,    43,     5,    56,
  246.     15,   -11,-32768,     2,-32768,-32768,    21,-32768,-32768,    21,
  247. -32768,    57,    38,-32768,-32768,-32768,    59,-32768,-32768,-32768,
  248.     56,-32768,-32768,-32768,-32768,-32768,     4,    46,-32768,-32768,
  249.     21,-32768,    -8,-32768,-32768,    75,    -1,-32768,-32768,    55,
  250. -32768,-32768,    80,    81,-32768
  251. };
  252.  
  253. static const short yypgoto[] = {-32768,
  254. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  255. -32768,    22,   -14,    -5,-32768,    32,   -31,-32768,    41,-32768
  256. };
  257.  
  258.  
  259. #define    YYLAST        84
  260.  
  261.  
  262. static const short yytable[] = {    53,
  263.     -1,    16,    80,    17,    68,    36,    68,    50,    77,     4,
  264.     18,    19,    48,    20,    21,    78,    66,    64,    42,    60,
  265.     11,    61,    81,    17,    52,    22,    23,    24,    17,    25,
  266.     18,    69,    70,    75,    13,    18,    46,    34,    47,    53,
  267.     65,    35,    14,    43,    45,    22,    23,    24,    37,    25,
  268.     22,    23,    24,    54,    25,    58,   -25,    59,    55,    56,
  269.     57,     2,    73,    38,    62,    -4,    -4,    -4,     5,     6,
  270.      7,    49,    50,    51,    72,    50,    76,    79,    82,    84,
  271.     85,    71,    74,    67
  272. };
  273.  
  274. static const short yycheck[] = {    31,
  275.      0,     1,     4,     3,     3,    20,     3,    19,    17,    12,
  276.     10,    11,    27,    13,    14,    24,    28,     3,    24,    15,
  277.      8,    17,    24,     3,    30,    25,    26,    27,     3,    29,
  278.     10,    30,    47,    30,     1,    10,    11,     8,    13,    71,
  279.     26,    12,     9,    13,    12,    25,    26,    27,     1,    29,
  280.     25,    26,    27,    16,    29,     9,     9,    15,    21,    22,
  281.     23,     1,     4,    16,     9,     5,     6,     7,     5,     6,
  282.      7,    18,    19,    20,    18,    19,    31,     3,    24,     0,
  283.      0,    50,    61,    43
  284. };
  285. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  286. #line 3 "bison.simple"
  287.  
  288. /* Skeleton output parser for bison,
  289.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  290.  
  291.    This program is free software; you can redistribute it and/or modify
  292.    it under the terms of the GNU General Public License as published by
  293.    the Free Software Foundation; either version 1, or (at your option)
  294.    any later version.
  295.  
  296.    This program is distributed in the hope that it will be useful,
  297.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  298.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  299.    GNU General Public License for more details.
  300.  
  301.    You should have received a copy of the GNU General Public License
  302.    along with this program; if not, write to the Free Software
  303.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  304.  
  305.  
  306. #ifndef alloca
  307. #ifdef __GNUC__
  308. #define alloca __builtin_alloca
  309. #else /* not GNU C.  */
  310. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  311. #include <alloca.h>
  312. #else /* not sparc */
  313. #if defined (MSDOS) && !defined (__TURBOC__)
  314. #include <malloc.h>
  315. #else /* not MSDOS, or __TURBOC__ */
  316. #if defined(_AIX)
  317. #include <malloc.h>
  318.  #pragma alloca
  319. #endif /* not _AIX */
  320. #endif /* not MSDOS, or __TURBOC__ */
  321. #endif /* not sparc.  */
  322. #endif /* not GNU C.  */
  323. #endif /* alloca not defined.  */
  324.  
  325. /* This is the parser code that is written into each bison parser
  326.   when the %semantic_parser declaration is not specified in the grammar.
  327.   It was written by Richard Stallman by simplifying the hairy parser
  328.   used when %semantic_parser is specified.  */
  329.  
  330. /* Note: there must be only one dollar sign in this file.
  331.    It is replaced by the list of actions, each action
  332.    as one case of the switch.  */
  333.  
  334. #define yyerrok        (yyerrstatus = 0)
  335. #define yyclearin    (yychar = YYEMPTY)
  336. #define YYEMPTY        -2
  337. #define YYEOF        0
  338. #define YYACCEPT    return(0)
  339. #define YYABORT     return(1)
  340. #define YYERROR        goto yyerrlab1
  341. /* Like YYERROR except do call yyerror.
  342.    This remains here temporarily to ease the
  343.    transition to the new meaning of YYERROR, for GCC.
  344.    Once GCC version 2 has supplanted version 1, this can go.  */
  345. #define YYFAIL        goto yyerrlab
  346. #define YYRECOVERING()  (!!yyerrstatus)
  347. #define YYBACKUP(token, value) \
  348. do                                \
  349.   if (yychar == YYEMPTY && yylen == 1)                \
  350.     { yychar = (token), yylval = (value);            \
  351.       yychar1 = YYTRANSLATE (yychar);                \
  352.       YYPOPSTACK;                        \
  353.       goto yybackup;                        \
  354.     }                                \
  355.   else                                \
  356.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  357. while (0)
  358.  
  359. #define YYTERROR    1
  360. #define YYERRCODE    256
  361.  
  362. #ifndef YYPURE
  363. #define YYLEX        yylex()
  364. #endif
  365.  
  366. #ifdef YYPURE
  367. #ifdef YYLSP_NEEDED
  368. #define YYLEX        yylex(&yylval, &yylloc)
  369. #else
  370. #define YYLEX        yylex(&yylval)
  371. #endif
  372. #endif
  373.  
  374. /* If nonreentrant, generate the variables here */
  375.  
  376. #ifndef YYPURE
  377.  
  378. int    yychar;            /*  the lookahead symbol        */
  379. YYSTYPE    yylval;            /*  the semantic value of the        */
  380.                 /*  lookahead symbol            */
  381.  
  382. #ifdef YYLSP_NEEDED
  383. YYLTYPE yylloc;            /*  location data for the lookahead    */
  384.                 /*  symbol                */
  385. #endif
  386.  
  387. int yynerrs;            /*  number of parse errors so far       */
  388. #endif  /* not YYPURE */
  389.  
  390. #if YYDEBUG != 0
  391. int yydebug;            /*  nonzero means print parse trace    */
  392. /* Since this is uninitialized, it does not stop multiple parsers
  393.    from coexisting.  */
  394. #endif
  395.  
  396. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  397.  
  398. #ifndef    YYINITDEPTH
  399. #define YYINITDEPTH 200
  400. #endif
  401.  
  402. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  403.     (effective only if the built-in stack extension method is used).  */
  404.  
  405. #if YYMAXDEPTH == 0
  406. #undef YYMAXDEPTH
  407. #endif
  408.  
  409. #ifndef YYMAXDEPTH
  410. #define YYMAXDEPTH 10000
  411. #endif
  412.  
  413. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  414. #define __yy_bcopy(FROM,TO,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  415. #else                /* not GNU C or C++ */
  416. #ifndef __cplusplus
  417.  
  418. /* This is the most reliable way to avoid incompatibilities
  419.    in available built-in functions on various systems.  */
  420. static void
  421. __yy_bcopy (from, to, count)
  422.      char *from;
  423.      char *to;
  424.      int count;
  425. {
  426.   register char *f = from;
  427.   register char *t = to;
  428.   register int i = count;
  429.  
  430.   while (i-- > 0)
  431.     *t++ = *f++;
  432. }
  433.  
  434. #else /* __cplusplus */
  435.  
  436. /* This is the most reliable way to avoid incompatibilities
  437.    in available built-in functions on various systems.  */
  438. static void
  439. __yy_bcopy (char *from, char *to, int count)
  440. {
  441.   register char *f = from;
  442.   register char *t = to;
  443.   register int i = count;
  444.  
  445.   while (i-- > 0)
  446.     *t++ = *f++;
  447. }
  448.  
  449. #endif
  450. #endif
  451.  
  452. #line 169 "bison.simple"
  453. int
  454. yyparse()
  455. {
  456.   register int yystate;
  457.   register int yyn;
  458.   register short *yyssp;
  459.   register YYSTYPE *yyvsp;
  460.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  461.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  462.  
  463.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  464.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  465.  
  466.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  467.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  468.  
  469. #ifdef YYLSP_NEEDED
  470.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  471.   YYLTYPE *yyls = yylsa;
  472.   YYLTYPE *yylsp;
  473.  
  474. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  475. #else
  476. #define YYPOPSTACK   (yyvsp--, yyssp--)
  477. #endif
  478.  
  479.   int yystacksize = YYINITDEPTH;
  480.  
  481. #ifdef YYPURE
  482.   int yychar;
  483.   YYSTYPE yylval;
  484.   int yynerrs;
  485. #ifdef YYLSP_NEEDED
  486.   YYLTYPE yylloc;
  487. #endif
  488. #endif
  489.  
  490.   YYSTYPE yyval;        /*  the variable used to return        */
  491.                 /*  semantic values from the action    */
  492.                 /*  routines                */
  493.  
  494.   int yylen;
  495.  
  496. #if YYDEBUG != 0
  497.   if (yydebug)
  498.     fprintf(stderr, "Starting parse\n");
  499. #endif
  500.  
  501.   yystate = 0;
  502.   yyerrstatus = 0;
  503.   yynerrs = 0;
  504.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  505.  
  506.   /* Initialize stack pointers.
  507.      Waste one element of value and location stack
  508.      so that they stay on the same level as the state stack.  */
  509.  
  510.   yyssp = yyss - 1;
  511.   yyvsp = yyvs;
  512. #ifdef YYLSP_NEEDED
  513.   yylsp = yyls;
  514. #endif
  515.  
  516. /* Push a new state, which is found in  yystate  .  */
  517. /* In all cases, when you get here, the value and location stacks
  518.    have just been pushed. so pushing a state here evens the stacks.  */
  519. yynewstate:
  520.  
  521.   *++yyssp = yystate;
  522.  
  523.   if (yyssp >= yyss + yystacksize - 1)
  524.     {
  525.       /* Give user a chance to reallocate the stack */
  526.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  527.       YYSTYPE *yyvs1 = yyvs;
  528.       short *yyss1 = yyss;
  529. #ifdef YYLSP_NEEDED
  530.       YYLTYPE *yyls1 = yyls;
  531. #endif
  532.  
  533.       /* Get the current used size of the three stacks, in elements.  */
  534.       int size = yyssp - yyss + 1;
  535.  
  536. #ifdef yyoverflow
  537.       /* Each stack pointer address is followed by the size of
  538.      the data in use in that stack, in bytes.  */
  539.       yyoverflow("parser stack overflow",
  540.          &yyss1, size * sizeof (*yyssp),
  541.          &yyvs1, size * sizeof (*yyvsp),
  542. #ifdef YYLSP_NEEDED
  543.          &yyls1, size * sizeof (*yylsp),
  544. #endif
  545.          &yystacksize);
  546.  
  547.       yyss = yyss1; yyvs = yyvs1;
  548. #ifdef YYLSP_NEEDED
  549.       yyls = yyls1;
  550. #endif
  551. #else /* no yyoverflow */
  552.       /* Extend the stack our own way.  */
  553.       if (yystacksize >= YYMAXDEPTH)
  554.     {
  555.       yyerror("parser stack overflow");
  556.       return 2;
  557.     }
  558.       yystacksize *= 2;
  559.       if (yystacksize > YYMAXDEPTH)
  560.     yystacksize = YYMAXDEPTH;
  561.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  562.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  563.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  564.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  565. #ifdef YYLSP_NEEDED
  566.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  567.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  568. #endif
  569. #endif /* no yyoverflow */
  570.  
  571.       yyssp = yyss + size - 1;
  572.       yyvsp = yyvs + size - 1;
  573. #ifdef YYLSP_NEEDED
  574.       yylsp = yyls + size - 1;
  575. #endif
  576.  
  577. #if YYDEBUG != 0
  578.       if (yydebug)
  579.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  580. #endif
  581.  
  582.       if (yyssp >= yyss + yystacksize - 1)
  583.     YYABORT;
  584.     }
  585.  
  586. #if YYDEBUG != 0
  587.   if (yydebug)
  588.     fprintf(stderr, "Entering state %d\n", yystate);
  589. #endif
  590.  
  591.  yybackup:
  592.  
  593. /* Do appropriate processing given the current state.  */
  594. /* Read a lookahead token if we need one and don't already have one.  */
  595. /* yyresume: */
  596.  
  597.   /* First try to decide what to do without reference to lookahead token.  */
  598.  
  599.   yyn = yypact[yystate];
  600.   if (yyn == YYFLAG)
  601.     goto yydefault;
  602.  
  603.   /* Not known => get a lookahead token if don't already have one.  */
  604.  
  605.   /* yychar is either YYEMPTY or YYEOF
  606.      or a valid token in external form.  */
  607.  
  608.   if (yychar == YYEMPTY)
  609.     {
  610. #if YYDEBUG != 0
  611.       if (yydebug)
  612.     fprintf(stderr, "Reading a token: ");
  613. #endif
  614.       yychar = YYLEX;
  615.     }
  616.  
  617.   /* Convert token to internal form (in yychar1) for indexing tables with */
  618.  
  619.   if (yychar <= 0)        /* This means end of input. */
  620.     {
  621.       yychar1 = 0;
  622.       yychar = YYEOF;        /* Don't call YYLEX any more */
  623.  
  624. #if YYDEBUG != 0
  625.       if (yydebug)
  626.     fprintf(stderr, "Now at end of input.\n");
  627. #endif
  628.     }
  629.   else
  630.     {
  631.       yychar1 = YYTRANSLATE(yychar);
  632.  
  633. #if YYDEBUG != 0
  634.       if (yydebug)
  635.     {
  636.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  637.       /* Give the individual parser a way to print the precise meaning
  638.          of a token, for further debugging info.  */
  639. #ifdef YYPRINT
  640.       YYPRINT (stderr, yychar, yylval);
  641. #endif
  642.       fprintf (stderr, ")\n");
  643.     }
  644. #endif
  645.     }
  646.  
  647.   yyn += yychar1;
  648.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  649.     goto yydefault;
  650.  
  651.   yyn = yytable[yyn];
  652.  
  653.   /* yyn is what to do for this token type in this state.
  654.      Negative => reduce, -yyn is rule number.
  655.      Positive => shift, yyn is new state.
  656.        New state is final state => don't bother to shift,
  657.        just return success.
  658.      0, or most negative number => error.  */
  659.  
  660.   if (yyn < 0)
  661.     {
  662.       if (yyn == YYFLAG)
  663.     goto yyerrlab;
  664.       yyn = -yyn;
  665.       goto yyreduce;
  666.     }
  667.   else if (yyn == 0)
  668.     goto yyerrlab;
  669.  
  670.   if (yyn == YYFINAL)
  671.     YYACCEPT;
  672.  
  673.   /* Shift the lookahead token.  */
  674.  
  675. #if YYDEBUG != 0
  676.   if (yydebug)
  677.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  678. #endif
  679.  
  680.   /* Discard the token being shifted unless it is eof.  */
  681.   if (yychar != YYEOF)
  682.     yychar = YYEMPTY;
  683.  
  684.   *++yyvsp = yylval;
  685. #ifdef YYLSP_NEEDED
  686.   *++yylsp = yylloc;
  687. #endif
  688.  
  689.   /* count tokens shifted since error; after three, turn off error status.  */
  690.   if (yyerrstatus) yyerrstatus--;
  691.  
  692.   yystate = yyn;
  693.   goto yynewstate;
  694.  
  695. /* Do the default action for the current state.  */
  696. yydefault:
  697.  
  698.   yyn = yydefact[yystate];
  699.   if (yyn == 0)
  700.     goto yyerrlab;
  701.  
  702. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  703. yyreduce:
  704.   yylen = yyr2[yyn];
  705.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  706.  
  707. #if YYDEBUG != 0
  708.   if (yydebug)
  709.     {
  710.       int i;
  711.  
  712.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  713.            yyn, yyrline[yyn]);
  714.  
  715.       /* Print the symboles being reduced, and their result.  */
  716.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  717.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  718.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  719.     }
  720. #endif
  721.  
  722.  
  723.   switch (yyn) {
  724.  
  725. case 1:
  726. #line 83 "parse.y"
  727. { /* add default rule */
  728.             int def_rule;
  729.  
  730.             pat = cclinit();
  731.             cclnegate( pat );
  732.  
  733.             def_rule = mkstate( -pat );
  734.  
  735.             /* Remember the number of the default rule so we
  736.              * don't generate "can't match" warnings for it.
  737.              */
  738.             default_rule = num_rules;
  739.  
  740.             finish_rule( def_rule, false, 0, 0 );
  741.  
  742.             for ( i = 1; i <= lastsc; ++i )
  743.                 scset[i] = mkbranch( scset[i], def_rule );
  744.  
  745.             if ( spprdflt )
  746.                 add_action(
  747.                 "YY_FATAL_ERROR( \"flex scanner jammed\" )" );
  748.             else
  749.                 add_action( "ECHO" );
  750.  
  751.             add_action( ";\n\tYY_BREAK\n" );
  752.             ;
  753.     break;}
  754. case 2:
  755. #line 112 "parse.y"
  756. { /* initialize for processing rules */
  757.  
  758.             /* Create default DFA start condition. */
  759.             scinstal( "INITIAL", false );
  760.  
  761.             /* Initially, the start condition scoping is
  762.              * "no start conditions active".
  763.              */
  764.             actvp = 0;
  765.             ;
  766.     break;}
  767. case 5:
  768. #line 127 "parse.y"
  769. { synerr( "unknown error processing section 1" ); ;
  770.     break;}
  771. case 6:
  772. #line 131 "parse.y"
  773. {
  774.             /* We now know how many start conditions there
  775.              * are, so create the "activity" map indicating
  776.              * which conditions are active.
  777.              */
  778.             active_ss = allocate_integer_array( lastsc + 1 );
  779.  
  780.             for ( i = 1; i <= lastsc; ++i )
  781.                 active_ss[i] = 0;
  782.             ;
  783.     break;}
  784. case 7:
  785. #line 144 "parse.y"
  786. { xcluflg = false; ;
  787.     break;}
  788. case 8:
  789. #line 147 "parse.y"
  790. { xcluflg = true; ;
  791.     break;}
  792. case 9:
  793. #line 151 "parse.y"
  794. { scinstal( nmstr, xcluflg ); ;
  795.     break;}
  796. case 10:
  797. #line 154 "parse.y"
  798. { scinstal( nmstr, xcluflg ); ;
  799.     break;}
  800. case 11:
  801. #line 157 "parse.y"
  802. { synerr( "bad start condition list" ); ;
  803.     break;}
  804. case 14:
  805. #line 165 "parse.y"
  806. {
  807.             /* Initialize for a parse of one rule. */
  808.             trlcontxt = variable_trail_rule = varlength = false;
  809.             trailcnt = headcnt = rulelen = 0;
  810.             current_state_type = STATE_NORMAL;
  811.             previous_continued_action = continued_action;
  812.             new_rule();
  813.             ;
  814.     break;}
  815. case 15:
  816. #line 176 "parse.y"
  817. {
  818.             pat = yyvsp[0];
  819.             finish_rule( pat, variable_trail_rule,
  820.                 headcnt, trailcnt );
  821.  
  822.             for ( i = 1; i <= actvp; ++i )
  823.                 scbol[actvsc[i]] =
  824.                     mkbranch( scbol[actvsc[i]], pat );
  825.  
  826.             if ( ! bol_needed )
  827.                 {
  828.                 bol_needed = true;
  829.  
  830.                 if ( performance_report > 1 )
  831.                     pinpoint_message( 
  832.             "'^' operator results in sub-optimal performance" );
  833.                 }
  834.             ;
  835.     break;}
  836. case 16:
  837. #line 196 "parse.y"
  838. {
  839.             pat = yyvsp[0];
  840.             finish_rule( pat, variable_trail_rule,
  841.                 headcnt, trailcnt );
  842.  
  843.             for ( i = 1; i <= actvp; ++i )
  844.                 scset[actvsc[i]] =
  845.                     mkbranch( scset[actvsc[i]], pat );
  846.             ;
  847.     break;}
  848. case 17:
  849. #line 207 "parse.y"
  850. {
  851.             pat = yyvsp[0];
  852.             finish_rule( pat, variable_trail_rule,
  853.                 headcnt, trailcnt );
  854.  
  855.             /* Add to all non-exclusive start conditions,
  856.              * including the default (0) start condition.
  857.              */
  858.  
  859.             for ( i = 1; i <= lastsc; ++i )
  860.                 if ( ! scxclu[i] )
  861.                     scbol[i] = mkbranch( scbol[i], pat );
  862.  
  863.             if ( ! bol_needed )
  864.                 {
  865.                 bol_needed = true;
  866.  
  867.                 if ( performance_report > 1 )
  868.                     pinpoint_message(
  869.             "'^' operator results in sub-optimal performance" );
  870.                 }
  871.             ;
  872.     break;}
  873. case 18:
  874. #line 231 "parse.y"
  875. {
  876.             pat = yyvsp[0];
  877.             finish_rule( pat, variable_trail_rule,
  878.                 headcnt, trailcnt );
  879.  
  880.             for ( i = 1; i <= lastsc; ++i )
  881.                 if ( ! scxclu[i] )
  882.                     scset[i] = mkbranch( scset[i], pat );
  883.             ;
  884.     break;}
  885. case 19:
  886. #line 242 "parse.y"
  887. { build_eof_action(); ;
  888.     break;}
  889. case 20:
  890. #line 245 "parse.y"
  891. {
  892.             /* This EOF applies to all start conditions
  893.              * which don't already have EOF actions.
  894.              */
  895.             actvp = 0;
  896.  
  897.             for ( i = 1; i <= lastsc; ++i )
  898.                 if ( ! sceof[i] )
  899.                     actvsc[++actvp] = i;
  900.  
  901.             if ( actvp == 0 )
  902.                 warn(
  903.             "all start conditions already have <<EOF>> rules" );
  904.  
  905.             else
  906.                 build_eof_action();
  907.             ;
  908.     break;}
  909. case 21:
  910. #line 264 "parse.y"
  911. { synerr( "unrecognized rule" ); ;
  912.     break;}
  913. case 23:
  914. #line 270 "parse.y"
  915. {
  916.             actvp = 0;
  917.  
  918.             for ( i = 1; i <= lastsc; ++i )
  919.                 actvsc[++actvp] = i;
  920.             ;
  921.     break;}
  922. case 25:
  923. #line 280 "parse.y"
  924. { actvp = 0; ;
  925.     break;}
  926. case 27:
  927. #line 283 "parse.y"
  928. { synerr( "bad start condition list" ); ;
  929.     break;}
  930. case 28:
  931. #line 287 "parse.y"
  932. {
  933.             if ( (scnum = sclookup( nmstr )) == 0 )
  934.                 format_pinpoint_message(
  935.                     "undeclared start condition %s",
  936.                     nmstr );
  937.             else
  938.                 {
  939.                 if ( ++actvp >= current_max_scs )
  940.                     /* Some bozo has included multiple
  941.                      * instances of start condition names.
  942.                      */
  943.                     pinpoint_message(
  944.                 "too many start conditions in <> construct!" );
  945.  
  946.                 else
  947.                     actvsc[actvp] = scnum;
  948.                 }
  949.             ;
  950.     break;}
  951. case 29:
  952. #line 308 "parse.y"
  953. {
  954.             if ( transchar[lastst[yyvsp[0]]] != SYM_EPSILON )
  955.                 /* Provide final transition \now/ so it
  956.                  * will be marked as a trailing context
  957.                  * state.
  958.                  */
  959.                 yyvsp[0] = link_machines( yyvsp[0],
  960.                         mkstate( SYM_EPSILON ) );
  961.  
  962.             mark_beginning_as_normal( yyvsp[0] );
  963.             current_state_type = STATE_NORMAL;
  964.  
  965.             if ( previous_continued_action )
  966.                 {
  967.                 /* We need to treat this as variable trailing
  968.                  * context so that the backup does not happen
  969.                  * in the action but before the action switch
  970.                  * statement.  If the backup happens in the
  971.                  * action, then the rules "falling into" this
  972.                  * one's action will *also* do the backup,
  973.                  * erroneously.
  974.                  */
  975.                 if ( ! varlength || headcnt != 0 )
  976.                     warn(
  977.         "trailing context made variable due to preceding '|' action" );
  978.  
  979.                 /* Mark as variable. */
  980.                 varlength = true;
  981.                 headcnt = 0;
  982.                 }
  983.  
  984.             if ( lex_compat || (varlength && headcnt == 0) )
  985.                 { /* variable trailing context rule */
  986.                 /* Mark the first part of the rule as the
  987.                  * accepting "head" part of a trailing
  988.                  * context rule.
  989.                  *
  990.                  * By the way, we didn't do this at the
  991.                  * beginning of this production because back
  992.                  * then current_state_type was set up for a
  993.                  * trail rule, and add_accept() can create
  994.                  * a new state ...
  995.                  */
  996.                 add_accept( yyvsp[-1],
  997.                     num_rules | YY_TRAILING_HEAD_MASK );
  998.                 variable_trail_rule = true;
  999.                 }
  1000.             
  1001.             else
  1002.                 trailcnt = rulelen;
  1003.  
  1004.             yyval = link_machines( yyvsp[-1], yyvsp[0] );
  1005.             ;
  1006.     break;}
  1007. case 30:
  1008. #line 363 "parse.y"
  1009. { synerr( "trailing context used twice" ); ;
  1010.     break;}
  1011. case 31:
  1012. #line 366 "parse.y"
  1013. {
  1014.             headcnt = 0;
  1015.             trailcnt = 1;
  1016.             rulelen = 1;
  1017.             varlength = false;
  1018.  
  1019.             current_state_type = STATE_TRAILING_CONTEXT;
  1020.  
  1021.             if ( trlcontxt )
  1022.                 {
  1023.                 synerr( "trailing context used twice" );
  1024.                 yyval = mkstate( SYM_EPSILON );
  1025.                 }
  1026.  
  1027.             else if ( previous_continued_action )
  1028.                 {
  1029.                 /* See the comment in the rule for "re2 re"
  1030.                  * above.
  1031.                  */
  1032.                 warn(
  1033.         "trailing context made variable due to preceding '|' action" );
  1034.  
  1035.                 varlength = true;
  1036.                 }
  1037.  
  1038.             if ( lex_compat || varlength )
  1039.                 {
  1040.                 /* Again, see the comment in the rule for
  1041.                  * "re2 re" above.
  1042.                  */
  1043.                 add_accept( yyvsp[-1],
  1044.                     num_rules | YY_TRAILING_HEAD_MASK );
  1045.                 variable_trail_rule = true;
  1046.                 }
  1047.  
  1048.             trlcontxt = true;
  1049.  
  1050.             eps = mkstate( SYM_EPSILON );
  1051.             yyval = link_machines( yyvsp[-1],
  1052.                 link_machines( eps, mkstate( '\n' ) ) );
  1053.             ;
  1054.     break;}
  1055. case 32:
  1056. #line 409 "parse.y"
  1057. {
  1058.             yyval = yyvsp[0];
  1059.  
  1060.             if ( trlcontxt )
  1061.                 {
  1062.                 if ( lex_compat || (varlength && headcnt == 0) )
  1063.                     /* Both head and trail are
  1064.                      * variable-length.
  1065.                      */
  1066.                     variable_trail_rule = true;
  1067.                 else
  1068.                     trailcnt = rulelen;
  1069.                 }
  1070.             ;
  1071.     break;}
  1072. case 33:
  1073. #line 427 "parse.y"
  1074. {
  1075.             varlength = true;
  1076.             yyval = mkor( yyvsp[-2], yyvsp[0] );
  1077.             ;
  1078.     break;}
  1079. case 34:
  1080. #line 433 "parse.y"
  1081. { yyval = yyvsp[0]; ;
  1082.     break;}
  1083. case 35:
  1084. #line 438 "parse.y"
  1085. {
  1086.             /* This rule is written separately so the
  1087.              * reduction will occur before the trailing
  1088.              * series is parsed.
  1089.              */
  1090.  
  1091.             if ( trlcontxt )
  1092.                 synerr( "trailing context used twice" );
  1093.             else
  1094.                 trlcontxt = true;
  1095.  
  1096.             if ( varlength )
  1097.                 /* We hope the trailing context is
  1098.                  * fixed-length.
  1099.                  */
  1100.                 varlength = false;
  1101.             else
  1102.                 headcnt = rulelen;
  1103.  
  1104.             rulelen = 0;
  1105.  
  1106.             current_state_type = STATE_TRAILING_CONTEXT;
  1107.             yyval = yyvsp[-1];
  1108.             ;
  1109.     break;}
  1110. case 36:
  1111. #line 465 "parse.y"
  1112. {
  1113.             /* This is where concatenation of adjacent patterns
  1114.              * gets done.
  1115.              */
  1116.             yyval = link_machines( yyvsp[-1], yyvsp[0] );
  1117.             ;
  1118.     break;}
  1119. case 37:
  1120. #line 473 "parse.y"
  1121. { yyval = yyvsp[0]; ;
  1122.     break;}
  1123. case 38:
  1124. #line 477 "parse.y"
  1125. {
  1126.             varlength = true;
  1127.  
  1128.             yyval = mkclos( yyvsp[-1] );
  1129.             ;
  1130.     break;}
  1131. case 39:
  1132. #line 484 "parse.y"
  1133. {
  1134.             varlength = true;
  1135.             yyval = mkposcl( yyvsp[-1] );
  1136.             ;
  1137.     break;}
  1138. case 40:
  1139. #line 490 "parse.y"
  1140. {
  1141.             varlength = true;
  1142.             yyval = mkopt( yyvsp[-1] );
  1143.             ;
  1144.     break;}
  1145. case 41:
  1146. #line 496 "parse.y"
  1147. {
  1148.             varlength = true;
  1149.  
  1150.             if ( yyvsp[-3] > yyvsp[-1] || yyvsp[-3] < 0 )
  1151.                 {
  1152.                 synerr( "bad iteration values" );
  1153.                 yyval = yyvsp[-5];
  1154.                 }
  1155.             else
  1156.                 {
  1157.                 if ( yyvsp[-3] == 0 )
  1158.                     {
  1159.                     if ( yyvsp[-1] <= 0 )
  1160.                         {
  1161.                         synerr(
  1162.                         "bad iteration values" );
  1163.                         yyval = yyvsp[-5];
  1164.                         }
  1165.                     else
  1166.                         yyval = mkopt(
  1167.                             mkrep( yyvsp[-5], 1, yyvsp[-1] ) );
  1168.                     }
  1169.                 else
  1170.                     yyval = mkrep( yyvsp[-5], yyvsp[-3], yyvsp[-1] );
  1171.                 }
  1172.             ;
  1173.     break;}
  1174. case 42:
  1175. #line 524 "parse.y"
  1176. {
  1177.             varlength = true;
  1178.  
  1179.             if ( yyvsp[-2] <= 0 )
  1180.                 {
  1181.                 synerr( "iteration value must be positive" );
  1182.                 yyval = yyvsp[-4];
  1183.                 }
  1184.  
  1185.             else
  1186.                 yyval = mkrep( yyvsp[-4], yyvsp[-2], INFINITY );
  1187.             ;
  1188.     break;}
  1189. case 43:
  1190. #line 538 "parse.y"
  1191. {
  1192.             /* The singleton could be something like "(foo)",
  1193.              * in which case we have no idea what its length
  1194.              * is, so we punt here.
  1195.              */
  1196.             varlength = true;
  1197.  
  1198.             if ( yyvsp[-1] <= 0 )
  1199.                 {
  1200.                 synerr( "iteration value must be positive" );
  1201.                 yyval = yyvsp[-3];
  1202.                 }
  1203.  
  1204.             else
  1205.                 yyval = link_machines( yyvsp[-3],
  1206.                         copysingl( yyvsp[-3], yyvsp[-1] - 1 ) );
  1207.             ;
  1208.     break;}
  1209. case 44:
  1210. #line 557 "parse.y"
  1211. {
  1212.             if ( ! madeany )
  1213.                 {
  1214.                 /* Create the '.' character class. */
  1215.                 anyccl = cclinit();
  1216.                 ccladd( anyccl, '\n' );
  1217.                 cclnegate( anyccl );
  1218.  
  1219.                 if ( useecs )
  1220.                     mkeccl( ccltbl + cclmap[anyccl],
  1221.                         ccllen[anyccl], nextecm,
  1222.                         ecgroup, csize, csize );
  1223.  
  1224.                 madeany = true;
  1225.                 }
  1226.  
  1227.             ++rulelen;
  1228.  
  1229.             yyval = mkstate( -anyccl );
  1230.             ;
  1231.     break;}
  1232. case 45:
  1233. #line 579 "parse.y"
  1234. {
  1235.             if ( ! cclsorted )
  1236.                 /* Sort characters for fast searching.  We
  1237.                  * use a shell sort since this list could
  1238.                  * be large.
  1239.                  */
  1240.                 cshell( ccltbl + cclmap[yyvsp[0]], ccllen[yyvsp[0]], true );
  1241.  
  1242.             if ( useecs )
  1243.                 mkeccl( ccltbl + cclmap[yyvsp[0]], ccllen[yyvsp[0]],
  1244.                     nextecm, ecgroup, csize, csize );
  1245.  
  1246.             ++rulelen;
  1247.  
  1248.             yyval = mkstate( -yyvsp[0] );
  1249.             ;
  1250.     break;}
  1251. case 46:
  1252. #line 597 "parse.y"
  1253. {
  1254.             ++rulelen;
  1255.  
  1256.             yyval = mkstate( -yyvsp[0] );
  1257.             ;
  1258.     break;}
  1259. case 47:
  1260. #line 604 "parse.y"
  1261. { yyval = yyvsp[-1]; ;
  1262.     break;}
  1263. case 48:
  1264. #line 607 "parse.y"
  1265. { yyval = yyvsp[-1]; ;
  1266.     break;}
  1267. case 49:
  1268. #line 610 "parse.y"
  1269. {
  1270.             ++rulelen;
  1271.  
  1272.             if ( caseins && yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1273.                 yyvsp[0] = clower( yyvsp[0] );
  1274.  
  1275.             yyval = mkstate( yyvsp[0] );
  1276.             ;
  1277.     break;}
  1278. case 50:
  1279. #line 621 "parse.y"
  1280. { yyval = yyvsp[-1]; ;
  1281.     break;}
  1282. case 51:
  1283. #line 624 "parse.y"
  1284. {
  1285.             cclnegate( yyvsp[-1] );
  1286.             yyval = yyvsp[-1];
  1287.             ;
  1288.     break;}
  1289. case 52:
  1290. #line 631 "parse.y"
  1291. {
  1292.             if ( caseins )
  1293.                 {
  1294.                 if ( yyvsp[-2] >= 'A' && yyvsp[-2] <= 'Z' )
  1295.                     yyvsp[-2] = clower( yyvsp[-2] );
  1296.                 if ( yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1297.                     yyvsp[0] = clower( yyvsp[0] );
  1298.                 }
  1299.  
  1300.             if ( yyvsp[-2] > yyvsp[0] )
  1301.                 synerr( "negative range in character class" );
  1302.  
  1303.             else
  1304.                 {
  1305.                 for ( i = yyvsp[-2]; i <= yyvsp[0]; ++i )
  1306.                     ccladd( yyvsp[-3], i );
  1307.  
  1308.                 /* Keep track if this ccl is staying in
  1309.                  * alphabetical order.
  1310.                  */
  1311.                 cclsorted = cclsorted && (yyvsp[-2] > lastchar);
  1312.                 lastchar = yyvsp[0];
  1313.                 }
  1314.  
  1315.             yyval = yyvsp[-3];
  1316.             ;
  1317.     break;}
  1318. case 53:
  1319. #line 659 "parse.y"
  1320. {
  1321.             if ( caseins && yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1322.                 yyvsp[0] = clower( yyvsp[0] );
  1323.  
  1324.             ccladd( yyvsp[-1], yyvsp[0] );
  1325.             cclsorted = cclsorted && (yyvsp[0] > lastchar);
  1326.             lastchar = yyvsp[0];
  1327.             yyval = yyvsp[-1];
  1328.             ;
  1329.     break;}
  1330. case 54:
  1331. #line 670 "parse.y"
  1332. {
  1333.             cclsorted = true;
  1334.             lastchar = 0;
  1335.             yyval = cclinit();
  1336.             ;
  1337.     break;}
  1338. case 55:
  1339. #line 678 "parse.y"
  1340. {
  1341.             if ( caseins && yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1342.                 yyvsp[0] = clower( yyvsp[0] );
  1343.  
  1344.             ++rulelen;
  1345.  
  1346.             yyval = link_machines( yyvsp[-1], mkstate( yyvsp[0] ) );
  1347.             ;
  1348.     break;}
  1349. case 56:
  1350. #line 688 "parse.y"
  1351. { yyval = mkstate( SYM_EPSILON ); ;
  1352.     break;}
  1353. }
  1354.    /* the action file gets copied in in place of this dollarsign */
  1355. #line 440 "bison.simple"
  1356.  
  1357.   yyvsp -= yylen;
  1358.   yyssp -= yylen;
  1359. #ifdef YYLSP_NEEDED
  1360.   yylsp -= yylen;
  1361. #endif
  1362.  
  1363. #if YYDEBUG != 0
  1364.   if (yydebug)
  1365.     {
  1366.       short *ssp1 = yyss - 1;
  1367.       fprintf (stderr, "state stack now");
  1368.       while (ssp1 != yyssp)
  1369.     fprintf (stderr, " %d", *++ssp1);
  1370.       fprintf (stderr, "\n");
  1371.     }
  1372. #endif
  1373.  
  1374.   *++yyvsp = yyval;
  1375.  
  1376. #ifdef YYLSP_NEEDED
  1377.   yylsp++;
  1378.   if (yylen == 0)
  1379.     {
  1380.       yylsp->first_line = yylloc.first_line;
  1381.       yylsp->first_column = yylloc.first_column;
  1382.       yylsp->last_line = (yylsp-1)->last_line;
  1383.       yylsp->last_column = (yylsp-1)->last_column;
  1384.       yylsp->text = 0;
  1385.     }
  1386.   else
  1387.     {
  1388.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1389.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1390.     }
  1391. #endif
  1392.  
  1393.   /* Now "shift" the result of the reduction.
  1394.      Determine what state that goes to,
  1395.      based on the state we popped back to
  1396.      and the rule number reduced by.  */
  1397.  
  1398.   yyn = yyr1[yyn];
  1399.  
  1400.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1401.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1402.     yystate = yytable[yystate];
  1403.   else
  1404.     yystate = yydefgoto[yyn - YYNTBASE];
  1405.  
  1406.   goto yynewstate;
  1407.  
  1408. yyerrlab:   /* here on detecting error */
  1409.  
  1410.   if (! yyerrstatus)
  1411.     /* If not already recovering from an error, report this error.  */
  1412.     {
  1413.       ++yynerrs;
  1414.  
  1415. #ifdef YYERROR_VERBOSE
  1416.       yyn = yypact[yystate];
  1417.  
  1418.       if (yyn > YYFLAG && yyn < YYLAST)
  1419.     {
  1420.       int size = 0;
  1421.       char *msg;
  1422.       int x, count;
  1423.  
  1424.       count = 0;
  1425.       for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1426.         if (yycheck[x + yyn] == x)
  1427.           size += strlen(yytname[x]) + 15, count++;
  1428.       msg = (char *) malloc(size + 15);
  1429.       if (msg != 0)
  1430.         {
  1431.           strcpy(msg, "parse error");
  1432.  
  1433.           if (count < 5)
  1434.         {
  1435.           count = 0;
  1436.           for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1437.             if (yycheck[x + yyn] == x)
  1438.               {
  1439.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1440.             strcat(msg, yytname[x]);
  1441.             strcat(msg, "'");
  1442.             count++;
  1443.               }
  1444.         }
  1445.           yyerror(msg);
  1446.           free(msg);
  1447.         }
  1448.       else
  1449.         yyerror ("parse error; also virtual memory exceeded");
  1450.     }
  1451.       else
  1452. #endif /* YYERROR_VERBOSE */
  1453.     yyerror("parse error");
  1454.     }
  1455.  
  1456. yyerrlab1:   /* here on error raised explicitly by an action */
  1457.  
  1458.   if (yyerrstatus == 3)
  1459.     {
  1460.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1461.  
  1462.       /* return failure if at end of input */
  1463.       if (yychar == YYEOF)
  1464.     YYABORT;
  1465.  
  1466. #if YYDEBUG != 0
  1467.       if (yydebug)
  1468.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1469. #endif
  1470.  
  1471.       yychar = YYEMPTY;
  1472.     }
  1473.  
  1474.   /* Else will try to reuse lookahead token
  1475.      after shifting the error token.  */
  1476.  
  1477.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1478.  
  1479.   goto yyerrhandle;
  1480.  
  1481. yyerrdefault:  /* current state does not do anything special for the error token. */
  1482.  
  1483. #if 0
  1484.   /* This is wrong; only states that explicitly want error tokens
  1485.      should shift them.  */
  1486.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1487.   if (yyn) goto yydefault;
  1488. #endif
  1489.  
  1490. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1491.  
  1492.   if (yyssp == yyss) YYABORT;
  1493.   yyvsp--;
  1494.   yystate = *--yyssp;
  1495. #ifdef YYLSP_NEEDED
  1496.   yylsp--;
  1497. #endif
  1498.  
  1499. #if YYDEBUG != 0
  1500.   if (yydebug)
  1501.     {
  1502.       short *ssp1 = yyss - 1;
  1503.       fprintf (stderr, "Error: state stack now");
  1504.       while (ssp1 != yyssp)
  1505.     fprintf (stderr, " %d", *++ssp1);
  1506.       fprintf (stderr, "\n");
  1507.     }
  1508. #endif
  1509.  
  1510. yyerrhandle:
  1511.  
  1512.   yyn = yypact[yystate];
  1513.   if (yyn == YYFLAG)
  1514.     goto yyerrdefault;
  1515.  
  1516.   yyn += YYTERROR;
  1517.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1518.     goto yyerrdefault;
  1519.  
  1520.   yyn = yytable[yyn];
  1521.   if (yyn < 0)
  1522.     {
  1523.       if (yyn == YYFLAG)
  1524.     goto yyerrpop;
  1525.       yyn = -yyn;
  1526.       goto yyreduce;
  1527.     }
  1528.   else if (yyn == 0)
  1529.     goto yyerrpop;
  1530.  
  1531.   if (yyn == YYFINAL)
  1532.     YYACCEPT;
  1533.  
  1534. #if YYDEBUG != 0
  1535.   if (yydebug)
  1536.     fprintf(stderr, "Shifting error token, ");
  1537. #endif
  1538.  
  1539.   *++yyvsp = yylval;
  1540. #ifdef YYLSP_NEEDED
  1541.   *++yylsp = yylloc;
  1542. #endif
  1543.  
  1544.   yystate = yyn;
  1545.   goto yynewstate;
  1546. }
  1547. #line 691 "parse.y"
  1548.  
  1549.  
  1550.  
  1551. /* build_eof_action - build the "<<EOF>>" action for the active start
  1552.  *                    conditions
  1553.  */
  1554.  
  1555. void build_eof_action()
  1556.     {
  1557.     register int i;
  1558.     char action_text[MAXLINE];
  1559.  
  1560.     for ( i = 1; i <= actvp; ++i )
  1561.         {
  1562.         if ( sceof[actvsc[i]] )
  1563.             format_pinpoint_message(
  1564.                 "multiple <<EOF>> rules for start condition %s",
  1565.                 scname[actvsc[i]] );
  1566.  
  1567.         else
  1568.             {
  1569.             sceof[actvsc[i]] = true;
  1570.             sprintf( action_text, "case YY_STATE_EOF(%s):\n",
  1571.             scname[actvsc[i]] );
  1572.             add_action( action_text );
  1573.             }
  1574.         }
  1575.  
  1576.     line_directive_out( (FILE *) 0 );
  1577.  
  1578.     /* This isn't a normal rule after all - don't count it as
  1579.      * such, so we don't have any holes in the rule numbering
  1580.      * (which make generating "rule can never match" warnings
  1581.      * more difficult.
  1582.      */
  1583.     --num_rules;
  1584.     ++num_eof_rules;
  1585.     }
  1586.  
  1587.  
  1588. /* format_synerr - write out formatted syntax error */
  1589.  
  1590. void format_synerr( msg, arg )
  1591. char msg[], arg[];
  1592.     {
  1593.     char errmsg[MAXLINE];
  1594.  
  1595.     (void) sprintf( errmsg, msg, arg );
  1596.     synerr( errmsg );
  1597.     }
  1598.  
  1599.  
  1600. /* synerr - report a syntax error */
  1601.  
  1602. void synerr( str )
  1603. char str[];
  1604.     {
  1605.     syntaxerror = true;
  1606.     pinpoint_message( str );
  1607.     }
  1608.  
  1609.  
  1610. /* warn - report a warning, unless -w was given */
  1611.  
  1612. void warn( str )
  1613. char str[];
  1614.     {
  1615.     line_warning( str, linenum );
  1616.     }
  1617.  
  1618. /* format_pinpoint_message - write out a message formatted with one string,
  1619.  *                 pinpointing its location
  1620.  */
  1621.  
  1622. void format_pinpoint_message( msg, arg )
  1623. char msg[], arg[];
  1624.     {
  1625.     char errmsg[MAXLINE];
  1626.  
  1627.     (void) sprintf( errmsg, msg, arg );
  1628.     pinpoint_message( errmsg );
  1629.     }
  1630.  
  1631.  
  1632. /* pinpoint_message - write out a message, pinpointing its location */
  1633.  
  1634. void pinpoint_message( str )
  1635. char str[];
  1636.     {
  1637.     line_pinpoint( str, linenum );
  1638.     }
  1639.  
  1640.  
  1641. /* line_warning - report a warning at a given line, unless -w was given */
  1642.  
  1643. void line_warning( str, line )
  1644. char str[];
  1645. int line;
  1646.     {
  1647.     char warning[MAXLINE];
  1648.  
  1649.     if ( ! nowarn )
  1650.         {
  1651.         sprintf( warning, "warning, %s", str );
  1652.         line_pinpoint( warning, line );
  1653.         }
  1654.     }
  1655.  
  1656.  
  1657. /* line_pinpoint - write out a message, pinpointing it at the given line */
  1658.  
  1659. void line_pinpoint( str, line )
  1660. char str[];
  1661. int line;
  1662.     {
  1663.     fprintf( stderr, "\"%s\", line %d: %s\n", infilename, line, str );
  1664.     }
  1665.  
  1666.  
  1667. /* yyerror - eat up an error message from the parser;
  1668.  *         currently, messages are ignore
  1669.  */
  1670.  
  1671. void yyerror( msg )
  1672. char msg[];
  1673.     {
  1674.     }
  1675.